<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body style="height: 2000px;">

  <script src="./jquery-3.6.0.js"></script>
  <script>
    // 滚动条滚动的时候，获取滚动条的位置
    $(window).on('scroll', function () {
      // console.log(123);
      console.log($(this).scrollTop()); // scrollTop() 必须加小括号，因为它是方法
    })
  </script>

</body>

</html>